	<script language="javascript" type="text/javascript">
	function ajaxFunction(){
		var ajaxRequest;  // The variable that makes Ajax possible!
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById(\'formcontent\');
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
				// Refresh the page is login is successful
				if(ajaxRequest.responseText == ""){
					// window.location = "'.$addr.'/org";
				}
			}
		}
		var location;
		var NGO;
		var IND;
		var BUS;
		
		if(document.getElementById(\'state\').checked){
			location = "state";
		}else if(document.getElementById(\'national\').checked){
			location = "national";
		}else if(document.getElementById(\'city\').checked){
			location = "city";
		}
		
		if(document.getElementById(\'NGO\').checked){
			NGO = "on";
		}else{
			NGO = "off";
		}
		if(document.getElementById(\'IND\').checked){
			IND = "on";
		}else{
			IND = "off";
		}
		if(document.getElementById(\'BUS\').checked){
			BUS = "on";
		}else{
			BUS = "off";
		}
		var search = document.getElementById(\'search\').value;
		var tags = document.getElementById(\'tags\').value;

		var queryString = "?search=" + search + "&tags=" + tags + "&location=" + location + "&NGO=" + NGO + "&BUS=" + BUS + "&IND=" + IND;
		ajaxRequest.open("GET", "search_ajax.php" + queryString, true);
		ajaxRequest.send(null); 
	}
	
	function enterKeyPress(e){
		var keycode;
		
		if (window.event) keycode = window.event.keycode;
		else if (e) keycode = e.which;
		
		if (keycode==13) {
			ajaxFunction();
		}
	}
	</script>